package com.yaopaikeji.constants;

import java.util.HashMap;
import java.util.Map;

public class Constants {

    /** 联系我们的status状态 */
    public static final int NOT_READ = 0;//未读
    public static final int READ = 1;//已读

    /** user 状态*/
    public static final int ACTIVE = 1;//激活状态
    public static final int INACTIVE = 0;//未激活状态

    /** 登陆 */
    public static final String LOGIN_ID = "loginId";
    public static final String PASS = "pass";

    /** session 中的当前用户的键 */
    public static final String CURRENT_USER = "CurrentUser";

    /** 用户角色 */
    public static final int ROLE_ADMIN_NUM = 2;
    public static final int ROLE_ROOT_NUM = 1;

    public static final String ROLE_ADMIN_NAME = "admin";
    public static final String ROLE_ROOT_NAME = "root";
    public static final String ROLE_ADMIN_PLUS = ROLE_ADMIN_NAME + "+";//admin 及以上权限

    /** 用户角色和代号映射 */
    public static final Map<String,Object> ROLE_NAME_NUM_MAP = new HashMap<String,Object>(){
        {
            put(ROLE_ADMIN_NAME,ROLE_ADMIN_NUM);
            put(ROLE_ROOT_NAME,ROLE_ROOT_NUM);
        }
    };

    /** 分页 pageSize*/
    public static final int PAGE_SIZE = 10;

    /** 邮件 */
    public static final String SENDER_MAIL = "xianhou.meng@yaopaikeji.com";//发件箱地址
    public static final String CONTACT_US_NOTIFY_SUBJECT = "处理联系我们";//联系我们发送邮件的主题

    /** 错误提示 */
    public static final String INSERT_ERROR_FMT = "增加%s数据失败";
    public static final String DELETE_ERROR_FMT = "删除%s数据失败";
    public static final String UPDATE_ERROR_FMT = "更新%s数据失败";
    public static final String SELECT_ERROR_FMT = "查询%s数据失败";
    public static final String NEED_MORE_AUTH = "需要更高的权限";
    public static final String LOGIN_FAIL_ERROR = "用户名不存在或用户名与密码不匹配";

}
